import time

from flask import Flask, request

app = Flask(__name__)


@app.route("/index")
def index():
    if request.method == "GET":
        args = request.args
        print("args>>>>>>>>>>>>", args)
        ret = {
            "code":10000,
            "data":{
                "name":args.get("name"),
            }
        }
        # TODO 模拟网络延迟
        time.sleep(2)
        return ret


if __name__ == '__main__':
    app.run("127.0.0.1", 9000)
